﻿using System;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LINQToolKit.Mapping
{
    public sealed class MetaAssociation
    {
        public string Name { get; set; }
        public string Key { get; set; }
        public string Source { get; set; }
        
        public MetaEntity Entity { get; set; }

        public bool IsRelativeSource
        {
            get
            {
                if (string.IsNullOrEmpty(this.Source))
                {
                    return false;
                }

                string regex = @"\w+:\/\/\w+";
                return !Regex.Match(this.Source, regex).Success;
            }
        }
    }
}
